< previous page page_746 next page >

Page 746
3. Select About dialog and click Open. A new form should be added to your program that looks like the one shown in Figure 33.2.
0746-01.jpg
Figure 33.2
Visual Basic includes a standard About Box form.
4. Decrease the size of the App Description label, lblDescription, so that you can fit an additional Label control on the form. (Changing the Height property to about 550 should do it for this example.)
5. Draw the new Label control beneath lblDescription and call it lblURL.
6. Open the Properties window for lblURL and make the following changes:
d6ef40187df115e88326dbc94f09ab9a.gif
Set the ForeColor property to light blue.
d6ef40187df115e88326dbc94f09ab9a.gif
Open the Font dialog box and turn on the Underline property.
d6ef40187df115e88326dbc94f09ab9a.gif
Set the Caption property to the URL of a Web sitewww.quecorp.com for this example.
After you perform the preceding steps, your label should look like an Internet hyperlink.
7. Add the code shown in Listing 33.2 in the label's Click event. This code opens the URL.
Listing 33.2 INETDEMO.ZIPLaunching a Web Site from a Form
Private Sub lblURL_Click()
    Dim nFile As Integer
    
    'WRITE A TEMP URL FILE
    nFile = FreeFile
    Open App.Path & "\TEMP.URL" For Output As #nFile
    Print #nFile, "[InternetShortcut]"
    Print #nFile, "URL=" & lblURL.Caption
    Close #nFile

    'LAUNCH THE BROWSER
    Shell "rundll32.exe shdocvw.dll,OpenURL " & App.Path & "\temp.url", _ 
           vbNormalFocus
    
    'DELETE THE TEMP FILE
    Kill App.Path & "\TEMP.URL"
End Sub

 
< previous page page_746 next page >